package com.example.dw.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户考试实体类
 * @author system
 * @since 2024-01-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_exams")
public class UserExam implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    @TableField("userid")
    private Integer userid;

    /**
     * 考试ID
     */
    @TableField("exam_id")
    private Integer examId;

    /**
     * 考试成绩
     */
    @TableField("score")
    private Float score;

    /**
     * 考试完成时间
     */
    @TableField("completed_at")
    private LocalDateTime completedAt;

    /**
     * 课程ID
     */
    @TableField("courseid")
    private Integer courseid;

    /**
     * 状态 (0-未完成 1-已完成)
     */
    @TableField("status")
    private Integer status;

    /**
     * 课程类型ID
     */
    @TableField("courseTypeid")
    private Integer courseTypeid;

    /**
     * 创建时间
     */
    @TableField("createdAt")
    private LocalDateTime createdAt;

    // 非数据库字段，用于关联查询
    /**
     * 考试名称
     */
    @TableField(exist = false)
    private String examName;

    /**
     * 用户名
     */
    @TableField(exist = false)
    private String username;

    /**
     * 课程类型名称
     */
    @TableField(exist = false)
    private String courseTypeName;
} 